//
//  HttpClient.h
//  iphone-commons
//
//  Created by DizainStudio on 16.01.11.
//  Copyright 2011 __MyCompanyName__. All rights reserved.
//

#import <Foundation/Foundation.h>


@interface HttpClient : NSObject {
	IBOutlet UIActivityIndicatorView* indicator ;
	NSMutableData *responseData;
	NSString* url;
	UIView* currentView;
	NSDictionary* params;
}

-(id) init:(NSString*) url withView: (UIView*) view;
-(id) init:(NSString*) url withParams:(NSDictionary*) params withView: (UIView*) view;

@property(retain) UIActivityIndicatorView* indicator ;
@property(nonatomic, assign) NSDictionary* params;
@property(nonatomic, assign) NSString* url ;
@property(nonatomic, assign) UIView* currentView ;

// public methods to use in client
-(void) doRequest;
-(void) handleResult;
-(void) dumpResult;

// protected method to implement in custom http clients 
-(NSString*) getHttpMethod;
-(NSString*) getUrlWithParams ;
-(NSData*) getHttpBody ;

// protected method to use in http clients
-(NSString*) createParams;
@end
